<!doctype html>
<html>
<head>
    <title>API for class TEMPLATE (idxCMS: Flat Files Content Management Sysytem ver. 5.0)</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="generator" content="phpAPI 6.0 (https://github.com/Greenray/phpAPI/)">
    <link href="../style.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <div class="page">
        <div class="header center">
            <div class="content">
                idxCMS: Flat Files Content Management Sysytem ver. 5.0                <div class="logo_desc">Application Programming Interface</div>
            </div>
        </div>
        <div class="panel">
            <div class="content">
                <h1>Namespaces</h1>
<ul>
    <li><a href="../administration/package-summary.html">Administration</a></li>
    <li><a href="../catalogs/package-summary.html">Catalogs</a></li>
    <li><a href="../core/package-summary.html">Core</a></li>
    <li><a href="../forum/package-summary.html">Forum</a></li>
    <li><a href="../gallery/package-summary.html">Gallery</a></li>
    <li><a href="../no package/package-summary.html">No Package</a></li>
    <li><a href="../polls/package-summary.html">Polls</a></li>
    <li><a href="../posts/package-summary.html">Posts</a></li>
    <li><a href="../rss/package-summary.html">RSS</a></li>
    <li><a href="../rate/package-summary.html">Rate</a></li>
    <li><a href="../search/package-summary.html">Search</a></li>
    <li><a href="../statistics/package-summary.html">Statistics</a></li>
    <li><a href="../tagcloud/package-summary.html">Tagcloud</a></li>
    <li><a href="../template/package-summary.html">Template</a></li>
    <li><a href="../tools/package-summary.html">Tools</a></li>
    <li><a href="../user/package-summary.html">User</a></li>
</ul>
<h1>Namespace User</h1>
    <h2>Classes</h2>
    <ul>
            <li><a href="../template/css.html" title="Template \ CSS">CSS</a></li>
            <li><a href="../template/template.html" title="Template \ TEMPLATE">TEMPLATE</a></li>
        </ul>
            </div>
        </div>
        <div class="main">
            <div class="content">
                <nav class="menu_main center"><div class="menu">
            <ul>
                    <li><a href="../index.html">Overview</a></li>
                    <li><a href="../template/package-summary.html">Namespace</a></li>
                    <li class="active">Class</li>
                    <li><a href="../template/package-tree.html">Template\Tree</a></li>
                    <li><a href="../deprecated.html">Deprecated</a></li>
                    <li><a href="../todo.html">Todo</a></li>
                    <li><a href="../index-all.html">Index</a></li>
                </ul>
    </div>
    <div class="small_links">
        <a href="#details_fields">Fields</a> | <a href="#details_methods">Methods</a> | <a href="#details_constructor">Constructor</a>
    </div>
</nav>
                <hr />
<div class="package">Namespace Template</div>
<h1>Class TEMPLATE</h1>
<div id="list">
    <ul>
        <li><strong>TEMPLATE</strong></li></ul></li>    </ul>
</div>
<hr />
<p class="arguments">public  class <strong>TEMPLATE</strong></p>
<div class="comment" id="overview_description">Templates parser.</div>
<div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Program</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">idxCMS: Flat Files Content Management System</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Version</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">5.0</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Author</td>
            <td class="hid right w_100 lilac"></td>
                            <td class="hid" colspan="2">David Casado Martínez &lt;tokkara@gmail.com&gt;</td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac"></td>
                            <td class="hid" colspan="2">Victor Nabatov &lt;greenray.spb@gmail.com&gt;</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Copyright</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">(c) 2011-2016 Victor Nabatov</td>
                    </tr>
            <tr>
            <td class="hid left w_100">License</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">Creative Commons Attribution-ShareAlike 4.0 International</td>
                    </tr>
            <tr>
            <td class="hid left w_100">File</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">classes/template.class.php</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Overview</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">Completely separated from php code.
 Handles special tags and replaces them with commands of the php interpreter.
 It is able recursively execute functions and directives:
 FOREACH, IF, ELSE, ELSEIF, SWITCH, CASE, BREAK, DEFAULT, INCLUDE, CONTINUE.
 There is a possibility of compressing and caching the result.</td>
                    </tr>
        </table>
</div>
    <h2 id="details_fields">Fields</h2>
            <div class="location">system/template.class.php at line 23</div>
        <pre class="arguments" id="code">private  string <strong><span class="green">$code</span></strong></pre>
        <div class="details">Template content</div>
        <hr />
            <div class="location">system/template.class.php at line 26</div>
        <pre class="arguments" id="file">private  string <strong><span class="green">$file</span></strong> = <span class="red">""</span></pre>
        <div class="details">Name of the template file that is executing</div>
        <hr />
            <div class="location">system/template.class.php at line 29</div>
        <pre class="arguments" id="line">private  integer <strong><span class="green">$line</span></strong> = 0</pre>
        <div class="details">Line of the template content</div>
        <hr />
            <div class="location">system/template.class.php at line 32</div>
        <pre class="arguments" id="options">private  array <strong><span class="green">$options</span></strong></pre>
        <div class="details">Array of the template options</div>
        <hr />
            <div class="location">system/template.class.php at line 35</div>
        <pre class="arguments" id="statements">private  array <strong><span class="green">$statements</span></strong> = [<br />        <span class="red">"BREAK"</span>    => <span class="red">"<?php break;?>"</span>,<br />        <span class="red">"CONTINUE"</span> => <span class="red">"<?php continue;?>"</span>,<br />        <span class="red">"ELSE"</span>     => <span class="red">"<?php } else { ?>"</span>,<br />        <span class="red">"DEFAULT"</span>  => <span class="red">"<?php default: ?>"</span>,<br />        <span class="red">"END"</span>      => <span class="red">"<?php } ?>"</span><br />    ]</pre>
        <div class="details">Template statements</div>
        <hr />
            <div class="location">system/template.class.php at line 38</div>
        <pre class="arguments" id="temp">private  array <strong><span class="green">$temp</span></strong> = []</pre>
        <div class="details">Temporary variable for code processing</div>
        <hr />
            <div class="location">system/template.class.php at line 41</div>
        <pre class="arguments" id="vars">private  array <strong><span class="green">$vars</span></strong> = []</pre>
        <div class="details">Array of the template variables</div>
        <hr />
        <h2 id="details_constructor">Constructor</h2>
    <div class="location">system/template.class.php at line 49</div>
    <code class="arguments" id="construct">public  void <strong>construct</strong>(<span class="lilac">array</span> <span class="blue">$template</span>, <span class="lilac">array</span> <span class="blue">$options</span>)</code>
    <div class="details">
            <p class="description">Class constructor.</p>
        <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid blue w_100">$template</td>
                <td class="hid">Template file</td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid blue w_100">$options</td>
                <td class="hid">Template parser options</td>
                    </tr>
        </table>
</div>
    </div>
    <h2 id="details_methods">Methods</h2>
            <div class="location">system/template.class.php at line 69</div>
        <code class="arguments" id="getTemplate">private  void <strong>getTemplate</strong> (<span class="lilac">string</span> <span class="blue">$template</span>)</code>
        <div class="details">
                    <p class="description">Reads template.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$template</td>
                <td class="hid">Template filename with full path or direct code</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 103</div>
        <code class="arguments" id="set">public  void <strong>set</strong> (<span class="lilac">mixed</span> <span class="blue">$var</span>, <span class="lilac">mixed</span> <span class="blue">$value</span>)</code>
        <div class="details">
                    <p class="description">Sets a variables (plain or array) of the template.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">mixed</td>
                            <td class="hid blue w_100">$var</td>
                <td class="hid">Variable name</td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac">mixed</td>
                            <td class="hid blue w_100">$value</td>
                <td class="hid">Variable value</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 114</div>
        <code class="arguments" id="parse">public  string <strong>parse</strong> ()</code>
        <div class="details">
                    <p class="description">Compiles the template file.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">Compiled template</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 177</div>
        <code class="arguments" id="parseLine">private  string <strong>parseLine</strong> (<span class="lilac">string</span> <span class="blue">$code</span>)</code>
        <div class="details">
                    <p class="description">Parses a line of code.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$code</td>
                <td class="hid">Line of code</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">Template transformed in php code</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 247</div>
        <code class="arguments" id="createVar">private  string <strong>createVar</strong> (<span class="lilac">string</span> <span class="blue">$code</span>)</code>
        <div class="details">
                    <p class="description">Trasnforms a template basic code (variables & operators) in php code.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$code</td>
                <td class="hid">Template basic code</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">PHP code</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 271</div>
        <code class="arguments" id="_foreach">private  string <strong>_foreach</strong> (<span class="lilac">string</span> <span class="blue">$param</span>)</code>
        <div class="details">
                    <p class="description">Trasnforms the FOREACH structure in php code.<br /> <pre><br /> The template is:<br />   <!-- FOREACH $array --><br />   <!-- FOREACH $array.index --><br />   <!-- CONTINUE --><br /> </pre></p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$param</td>
                <td class="hid">Parameters for FOREACH structure</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">PHP code</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 291</div>
        <code class="arguments" id="_if">private  string <strong>_if</strong> (<span class="lilac">string</span> <span class="blue">$code</span>)</code>
        <div class="details">
                    <p class="description">Transforms the IF structure in php code.<br /> <pre><br /> The template is:<br />   <!-- IF !empty($var) --><br /> </pre></p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$code</td>
                <td class="hid">Code for IF structure</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">PHP code</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 305</div>
        <code class="arguments" id="_switch">private  string <strong>_switch</strong> (<span class="lilac">string</span> <span class="blue">$param</span>)</code>
        <div class="details">
                    <p class="description">Transforms the SWITCH structure in php code.<br /> <pre><br /> The template is:<br />   <!-- SWITCH $var --><br /> </pre></p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$param</td>
                <td class="hid">Code for the SWITCH structure</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">PHP code</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 319</div>
        <code class="arguments" id="_case">private  string <strong>_case</strong> (<span class="lilac">string</span> <span class="blue">$code</span>)</code>
        <div class="details">
                    <p class="description">Transforms the CASE structure in php code.<br /> <pre><br /> The template is:<br />   <!-- CASE $var --><br /> </pre></p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$code</td>
                <td class="hid">Code for CASE structure</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">PHP code</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 336</div>
        <code class="arguments" id="translate">private  string <strong>translate</strong> (<span class="lilac">array</span> <span class="blue">$match</span>)</code>
        <div class="details">
                    <p class="description">Localization.<br /> <pre><br /> The template is:<br />   string<br /> </pre><br /> Array variable $match contains:<br />  - $matches[0] = part of template between control structures including them;<br />  - $matches[1] = part of template between control structures excluding them.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid blue w_100">$match</td>
                <td class="hid">Matches for translation</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">Parsed string</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 350</div>
        <code class="arguments" id="value">private  string <strong>value</strong> (<span class="lilac">array</span> <span class="blue">$match</span>)</code>
        <div class="details">
                    <p class="description">Replaces constants and global variables with their values.<br /> <pre><br /> The template is:<br />   {CONST} - global constant<br /> </pre></p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid blue w_100">$match</td>
                <td class="hid">Matches for constants</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">Parsed string</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 370</div>
        <code class="arguments" id="showElement">private  string <strong>showElement</strong> (<span class="lilac">string</span> <span class="blue">$element</span>, <span class="lilac">string</span> <span class="blue">$parameters</span>)</code>
        <div class="details">
                    <p class="description">Shows the content.<br /> <pre><br /> The template is:<br />   [show=main,{module}@main]<ul><li>main - module type (main, box и т.д)</li><li>{module} - module name</li><li>main - template type (defined in /skins/_skin_name_/skin.php</li></ul></pre></p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$element</td>
                <td class="hid">What to show</td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$parameters</td>
                <td class="hid">Parameters - type of the content block</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">Content</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 482</div>
        <code class="arguments" id="show">private  string <strong>show</strong> (<span class="lilac">array</span> <span class="blue">$matches</span>)</code>
        <div class="details">
                    <p class="description">Shows element.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid blue w_100">$matches</td>
                <td class="hid">Matches for parse</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">Parsed string</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 499</div>
        <code class="arguments" id="getFromCache">public  mixed <strong>getFromCache</strong> (<span class="lilac">string</span> <span class="blue">$file</span>)</code>
        <div class="details">
                    <p class="description">Gets a data from the cache.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$file</td>
                <td class="hid">Page name</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">mixed</td>
                            <td class="hid" colspan="2">Page from cache</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 517</div>
        <code class="arguments" id="toCache">public  void <strong>toCache</strong> (<span class="lilac">string</span> <span class="blue">$file</span>, <span class="lilac">string</span> <span class="blue">$data</span>)</code>
        <div class="details">
                    <p class="description">Places the compiled data into cache.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$file</td>
                <td class="hid">Page name</td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$data</td>
                <td class="hid">Page to store in the cache</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/template.class.php at line 533</div>
        <code class="arguments" id="compact">private  string <strong>compact</strong> (<span class="lilac">string</span> <span class="blue">$data</span>)</code>
        <div class="details">
                    <p class="description">Compacts compiled template.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$data</td>
                <td class="hid">Compiled template</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid" colspan="2">Code without newlines and extra spaces</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
                    <nav class="menu_main center"><div class="menu">
            <ul>
                    <li><a href="../index.html">Overview</a></li>
                    <li><a href="../template/package-summary.html">Namespace</a></li>
                    <li class="active">Class</li>
                    <li><a href="../template/package-tree.html">Template\Tree</a></li>
                    <li><a href="../deprecated.html">Deprecated</a></li>
                    <li><a href="../todo.html">Todo</a></li>
                    <li><a href="../index-all.html">Index</a></li>
                </ul>
    </div>
    <div class="small_links">
        <a href="#details_fields">Fields</a> | <a href="#details_methods">Methods</a> | <a href="#details_constructor">Constructor</a>
    </div>
</nav>
            </div>
        </div>
    </div>
    <div class="footer">
        <div class="content">
            <div class="copyright center">Generated by <a href="https://github.com/Greenray/phpAPI" target="_blank">phpAPI</a>: PHP Documentation Creator ver. 6.0 &copy; 2015 - 2016 Greenray</div>
        </div>
    </div>
</body>
</html>
